package com.example.student1.webapi;

import com.example.student1.domain.Student_Login;
import com.example.student1.domain.Teacher_Login;
import com.example.student1.service.Student_LoginService;
import com.example.student1.service.Teacher_LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@Slf4j
@RequestMapping("/webapi/user")
public class UserRestController {
    @Autowired
    private Student_LoginService student_LoginService;
    @Autowired
    private Teacher_LoginService teacher_LoginService;

    @RequestMapping(value = "/student/insert",method = RequestMethod.POST)
    public Student_Login insert(Student_Login student_login){

        Student_Login student = student_LoginService.insert(student_login);
        return student;
    }

    @RequestMapping(value = "/teacher/insert",method = RequestMethod.POST)
    public Teacher_Login insert(Teacher_Login teacher_login){
        Teacher_Login teacher =teacher_LoginService.insert(teacher_login);
        return teacher;
    }
}
